<?php
class yesnoradio extends radioset {
	public function __construct($currentvalue = null){
		parent::__construct();		
		$this->addValue(0, 'No');
		$this->addValue(1, 'Yes');
				
		if ( $currentvalue == 1){
			$this->setCheckedValue(1);
		} elseif ($currentvalue == 0) {
			$this->setCheckedValue(0);
		} elseif ( $currentvalue == true ){
			$this->setCheckedValue(1);		
		} elseif ($currentvalue == false) {
			$this->setCheckedValue(0);
		} elseif ( preg_match('/yes/i', $currentvalue)){
			$this->setCheckedValue(1);					
		} elseif ( preg_match('/no/i', $currentvalue)){
			$this->setCheckedValue(0);
		} elseif ( preg_match('/^active$/i', $currentvalue)){
			$this->setCheckedValue(1);					
		} elseif ( preg_match('/^inactive$/i', $currentvalue)){
			$this->setCheckedValue(0);
		} elseif ( preg_match('/^t$/i', $currentvalue)){
			$this->setCheckedValue(1);					
		} elseif ( preg_match('/^f$/i', $currentvalue)){
			$this->setCheckedValue(0);
		} elseif ( preg_match('/^si$/i', $currentvalue)){
			$this->setCheckedValue(1);							
		}		
	}
}
?>